home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / ccd0605.iso / Software / Freeware / Programare / highlight / highlight-W32GUI-2.2-10b-Setup.exe / {app} / src / latexgenerator.h < prev    next >
C/C++ Source or Header  |  2005-03-20  |  3KB  |  92 lines

  1. /***************************************************************************
  2.                           latexgenerator.h  -  description
  3.                              -------------------
  4.     begin                : Mit Jul 24 2002
  5.     copyright            : (C) 2002 by AndrΘ Simon
  6.     email                : andre.simon1@gmx.de
  7.  ***************************************************************************/
  8.  
  9. /***************************************************************************
  10.  *                                                                         *
  11.  *   This program is free software; you can redistribute it and/or modify  *
  12.  *   it under the terms of the GNU General Public License as published by  *
  13.  *   the Free Software Foundation; either version 2 of the License, or     *
  14.  *   (at your option) any later version.                                   *
  15.  *                                                                         *
  16.  ***************************************************************************/
  17.  
  18. #ifndef LATEXGENERATOR_H
  19. #define LATEXGENERATOR_H
  20.  
  21. #include <string>
  22. #include <iostream>
  23. #include <sstream>
  24.  
  25. #include "codegenerator.h"
  26. #include "version.h"
  27. #include "charcodes.h"
  28.  
  29.  
  30. namespace highlight {
  31.  
  32. /**
  33.    \brief This class generates LaTeX.
  34.  
  35.    It contains information about the resulting document structure (document
  36.    header and footer), the colour system, white space handling and text
  37.    formatting attributes.
  38.  
  39. * @author Andre Simon
  40. */
  41.  
  42. class LatexGenerator : public highlight::CodeGenerator
  43.   {
  44.   public:
  45.  
  46.    /** Constructor
  47.      \param colourTheme Name of Colour theme to use
  48.      \param replQuotes Test if quotes shold be replaced by \ dq
  49.     */
  50.     LatexGenerator(const string &colourTheme,
  51.                    bool replQuotes=false);
  52.     LatexGenerator();
  53.     ~LatexGenerator();
  54.  
  55.    /** prints document header
  56.        \param  title Title of the document
  57.     */
  58.     string getHeader(const string & title);
  59.  
  60.     /** Prints document footer*/
  61.     string getFooter();
  62.  
  63.     /** Prints document body*/
  64.     void printBody();
  65.  
  66.   private:
  67.  
  68.      string styleDefinitionCache;
  69.      string longLineTag;
  70.  
  71.     /** \return escaped character*/
  72.     virtual string maskCharacter(unsigned char );
  73.  
  74.     /**\return text formatting attributes in LaTeX format */
  75.     string formatStyleAttributes(const string & elemName,
  76.                                  const ElementStyle & elem);
  77.  
  78.     /** test if double quotes should be replaced by \dq{} */
  79.     bool replaceQuotes;
  80.  
  81.     string getNewLine();
  82.  
  83.     string getStyleDefinition();
  84.  
  85.     string getMatchingOpenTag(unsigned int styleID);
  86.     string getMatchingCloseTag(unsigned int styleID);
  87.   };
  88.  
  89. }
  90.  
  91. #endif
  92.